<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>姿态提取</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
        }
        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .form-group {
            margin-bottom: 20px;
        }
        .form-group input {
            padding: 10px;
            font-size: 16px;
        }
        .form-group button {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .form-group button:hover {
            background-color: #0056b3;
        }
        .image-preview {
            margin-top: 20px;
        }
        .image-preview img {
            max-width: 500px;
            max-height: 500px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>姿态提取</h1>
        <!-- 输入图片路径 -->
        <form method="POST" id="generateForm">
            {% csrf_token %}
            <div class="form-group">
                <label for="image_path">输入图片路径:</label>
                <input type="text" id="image_path" name="image_path" placeholder="例如：static/images/model.jpg" required>
            </div>
            <div class="form-group">
                <button type="submit" name="generate">生成</button>
            </div>
        </form>

        <!-- 显示生成的图片 -->
        {% if generated_image_path %}
        <div class="image-preview">
            <h3>生成的图片:</h3>
            <img src="{% static generated_image_path %}" alt="Generated Pose">
        </div>
        <form method="POST" id="saveForm">
            {% csrf_token %}
            <input type="hidden" name="generated_image_path" value="{{ generated_image_path }}">
            <div class="form-group">
                <button type="submit" name="save">保存</button>
            </div>
        </form>
        {% endif %}
    </div>
</body>
</html>
